local M = {}

M.dirExists = function (dir)
   local stat = vim.loop.fs_stat(dir) -- 使用 Neovim 的 libuv 接口检查文件状态
  return stat and stat.type == "directory" -- 如果文件状态存在且类型为目录，则返回 tr
end

M.isDir = function(path)
  local file = io.open(path, "r")
  if file then
    local isDirectory = (file:read("*l") == nil)
    file:close()
    return isDirectory
  end
  return false
end

M.mkDirs =function (path)
  return vim.fn.mkdir(path, "p")
end


return M
